package com.jy.project.controller;


import com.jy.project.service.MaterialAttrFieldService;
import com.jy.project.service.MaterialAttrValueService;
import com.jy.project.util.ServiceResultUtils;
import com.jy.project.vo.MaterialAttrFieldVO;
import com.jy.project.vo.MaterialFieldValueVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/v1")
@CrossOrigin
@Slf4j
public class MaterialAttrValueController {

    @Autowired
    private MaterialAttrValueService materialAttrValueService;

    /**
     * 根据资产查询资产扩展属性值
     *
     * @param materialNo
     * @return
     */
    @GetMapping("/material/{materialNo}/materialAttrValues")
    public Object listMaterialAttrValue(@PathVariable String materialNo) {
        List<MaterialFieldValueVO> resultList = materialAttrValueService.listMaterialAttrValue(materialNo);
        return ServiceResultUtils.success(resultList);
    }


}
